#pragma once
#include "Definition.h"

//Abstraction class of every object can be drawn ( but GUI )
class DisplayObject
{
public:
	DisplayObject(void);
	~DisplayObject(void);

	float &getAccelerator();// get Accelerator
	void setAccelerator(float newAccelerator);// set Accelerator

	CL_Vec2f &getVelocity();
	void setVelocity(CL_Vec2f newVelocity);

	CL_Pointf &getPos(); // get current position
	void setPos(CL_Pointf setPosition); // set new position

	CL_Colorf &getColor(); // get current color ( color in float scale )
	void setColor(CL_Colorf colorRGBA); // set color ( color in RGBA8 - red,green,blue,alpha - scale )

	void setStandSprite(CL_GraphicContext &gc, const CL_StringRef name, CL_ImageImportDescription &importDesc );

	void setCurrentSprite(CL_Sprite *arg);

	void updateVelocity(unsigned int time);// v = v0 + a*t ( v0: last velocity, a: accelerator, t (ms): distance of time while velocity changes from v0 to v  )
	void updatePosition(unsigned int time);// x = x0 + (v0 + a*t)*t

	void run(CL_GraphicContext &gc, unsigned int time); // main function of display object

private:
	

	CL_Sprite *currentSprite;
	CL_Sprite *standSprite;// sprite from resource.xml file
	std::vector<CL_Sprite*> trashSprite;

	CL_Pointf currentPos; // current position of display object
	CL_Sizex<float> currentSize;//
	CL_Colorf currentColor; // current color of display object
	CL_Vec2f velocity; // 
	float accelerator;// 
	float radian; // angle in radian scale ( used to rotate )
	float sizeRatio; // size scale of display object ( ex: 1.5f * displayObject's size --> 1.5f is sizeRatio )
	

	CL_CollisionOutline outline;// outline of image to detect collision
};

